import React, { Component } from 'react';
import ReactSwiper from 'reactjs-swiper';
import './style.scss'

export default class Swiper extends Component {
    constructor(props) {
        super(props)
        this.items = [{
            image: 'http://m.360buyimg.com/mobilecms/s750x366_jfs/t1/24046/10/6380/94217/5c511b9dEcc9ba39c/7913173ae5ed0617.jpg!cr_1125x549_0_72!q70.jpg.dpg',
            title: '图片1',
            link: 'http://jd.com'
        }, {
            image: '//m.360buyimg.com/mobilecms/s750x366_jfs/t1/72261/3/3303/97005/5d197f37Eca473095/241386534e272cc2.jpg!cr_1125x549_0_72!q70.jpg.dpg',
            title: '图片2',
        }, {
            image: '//m.360buyimg.com/mobilecms/s750x366_jfs/t1/76807/2/767/195496/5cefb701E8fda4bd5/aaea3f6c9f4b3a5e.jpg!cr_1125x549_0_72!q70.jpg.dpg',
            title: '图片3',
            link: 'http://jd.com'
        }, {
            image: '//imgcps.jd.com/ling4/29192519232/5pm66IO95omL546v54m55Y2W/5LiH5Y2D5aW954mp6ZKc5oOg5p2l6KKt/p-5c13515d82acdd181dcbdc39/94104da1/cr_1125x549_0_72/s1125x690/q70.jpg',
            title: '图片4',
        }];

        this.swiperOptions = {
            preloadImages: true,
            autoplay: 4000,
            autoplayDisableOnInteraction: false,
            width:window.innerWidth,
        };
    }
    render() {
        return (
            <ReactSwiper swiperOptions={this.swiperOptions} showPagination items={this.items}
                className="swiper-example" />
        )
    }
}